package org.darkforest.model;

import org.darkforest.enums.MessageTypeEnum;
import org.darkforest.common.util.DateUtil;

/**
 * 
 * 项目名称         :bwmall-common
 * 文件名           :MessageVo.java
 * 开发公司及作者    :陈超
 * 版本号及开发日期  :Rev. 1.00 (2015年2月23日)
 */
public class MessageVo extends Message {
	
	
	private Integer notReadCount;
//	private String messageTimeStr;
//
//	public void setMessageTimeStr(String messageTimeStr) {
//		this.messageTimeStr = messageTimeStr;
//	}

	public Integer getNotReadCount() {
		return notReadCount;
	}

	public void setNotReadCount(Integer notReadCount) {
		this.notReadCount = notReadCount;
	}

	public String getMessageTypeStr(){
		MessageTypeEnum e = MessageTypeEnum.getByValue(super.getMessageType());
		return e == null ? "" : e.getText();
	}
	
	public String getMessageTimeStr(){
		String str = null;
		if(super.getMessageUpdateTime()!=null&&super.getMessageUpdateTime() > 0){
			str = DateUtil.toIntDateString(super.getMessageUpdateTime());
		}else{
			str = DateUtil.toIntDateString(super.getMessageTime());
		}
		return str == null ? "" : str;
	}
	
	
}
